package cl.parser.internal;

import java.util.ArrayList;
import java.util.List;

import cl.parser.IParseNode;

public class FileNode extends InternalNode {

    @Override
    public String prettyPrint(String indent) {
        String res = "";
        
        for(IParseNode p : children) {
            res += p.prettyPrint(indent) + "\n";
        }
        
        return res.trim();
    }
    
    @Override
    protected List<IParseNode> getAllowed(IParseNode last, List<IParseNode> soFar) {
        List<IParseNode> allowed = new ArrayList<IParseNode>();
        
        allowed.add(new VariableDeclarationNode());
        allowed.add(new FunctionDeclarationNode());
        
        return allowed;
    }

    @Override
    protected boolean isValid(IParseNode last, List<IParseNode> soFar) {
        return true;
    }

}
